package com.gzyj.jtt808.v2019.protocol.yuebiao;


import com.gzyj.jtt808.v2011.additionalinfo.JTT808_AddtionalInfo;
import io.netty.buffer.ByteBuf;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.io.Serializable;

/**
 * @author lhj
 */
@Data
@ApiModel("安装异常信息")
public class JTT808_0x0200_0xF1 extends JTT808_AddtionalInfo implements Serializable {
    public Long Retain;

    public JTT808_0x0200_0xF1() {
        super(0xF1);
        this.setLength(4);
    }

    @Override
    public void encode(ByteBuf buf) {
        buf.writeByte(this.getID());
        buf.writeByte(this.getLength());

        buf.writeInt(Integer.parseUnsignedInt(String.valueOf(this.Retain)));
    }

    @Override
    public JTT808_0x0200_0xF1 decode(ByteBuf buf) {
        this.setLength(buf.readByte());
        this.Retain=buf.readUnsignedInt();
        return this;
    }


}
